// components/tabbar/tabbar.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    activeIndex:{
      type:Number
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    tabbar:[
      {
        index:0,
        icon:"/icon/tabbar/index.png",
        activeIcon:"/icon/tabbar/index-active.png",
        name:"首页",
        path:"/pages/index/index",
      },
      {
        index:1,
        icon:"/icon/tabbar/component.png",
        activeIcon:"/icon/tabbar/component-active.png",
        name:"组件",
        path:"/pages/component/component",
      },
      {
        index:2,
        icon:"/icon/tabbar/my.png",
        activeIcon:"/icon/tabbar/my-active.png",
        name:"我的",
        path:"/pages/my/my",
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    totabbar(e){
      let url =  app.common.getValue(e,"url");
      wx.switchTab({
        url:url
      })
    },
  }
})
